//
//  AllPageCollectionViewCell.m
//  MoGuRadio
//
//  Created by dlios on 15/6/4.
//  Copyright (c) 2015年 mogu.com 蘑菇科技. All rights reserved.
//

#import "AllPageCollectionViewCell.h"

@implementation AllPageCollectionViewCell

- (void)dealloc
{
    [_playImageView release];
    [_myLabel release];
    [_myImageView release];
    [super dealloc];
    
}

- (instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.myImageView = [[UIImageView alloc] init];
        self.myImageView.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1.0];
        [self.contentView addSubview:self.myImageView];
        [_myImageView release];
        
        
        self.playImageView = [[UIImageView alloc] init];
        self.playImageView.image = [UIImage imageNamed:@"bofang.png"];
        self.playImageView.userInteractionEnabled = YES;
        [self.contentView addSubview:self.playImageView];
        [_playImageView release];
        
        
        self.myLabel = [[UILabel alloc] init];
        self.myLabel.backgroundColor = [UIColor clearColor];
        self.myLabel.font = [UIFont systemFontOfSize:13];
        self.myLabel.numberOfLines = 2;
        [self.contentView addSubview:self.myLabel];
        [_myLabel release];

    }
    return self;
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.playImageView.frame = CGRectMake(LBVIEW_WIDTH1 / 18.5, LBVIEW_HEIGHT1 / 33, layoutAttributes.bounds.size.width / 1.7, layoutAttributes.bounds.size.height / 1.6);
    
    self.myImageView.frame = CGRectMake(0, 0, layoutAttributes.bounds.size.width / 1.0, layoutAttributes.bounds.size.height / 1.0);
    
    self.myLabel.frame = CGRectMake(0, layoutAttributes.bounds.size.height + 5, layoutAttributes.bounds.size.width, layoutAttributes.bounds.size.height / 7 + 20);
    
}

@end
